<template>
  <div id="app">
    <div class="container">
      <div class="logo">
        <img src="../assets/logo.png" alt="logo" />
      </div>
      <div class="form">
        <h1>登录</h1>
        <div class="input-group">
          <label for="username">用户名</label>
          <input type="text" id="username" v-model="username" />
        </div>
        <div class="input-group">
          <label for="password">密码</label>
          <input type="password" id="password" v-model="password" />
        </div>
        <div class="button-group">
          <button @click="login">登录</button>
          <button @click="register">注册</button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      username: "",
      password: "",
    };
  },
  methods: {
    login() {
      // TODO: implement login logic
      alert(`登录成功，欢迎${this.username}!`);
    },
    register() {
      // TODO: implement register logic
      alert("注册成功，请登录！");
    },
  },
};
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.container {
  width: 600px;
  height: 400px;
  margin: 50px auto;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.logo {
  width: 100%;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo img {
  width: 80px;
}

.form {
  width: 80%;
  margin: 0 auto;
}

.form h1 {
  text-align: center;
}

.input-group {
  margin: 20px 0;
}

.input-group label {
  display: block;
}

.input-group input {
  width: 100%;
  height: 30px;
}

.button-group {
  display: flex;
  justify-content: space-around;
}

.button-group button {
  width: 100px;
}

/* add some colors and transitions */
h1 {
  color: #333;
}

label {
  color: #666;
}

input {
  border-radius: 5px;
  border-color: #ddd;
  outline: none;
  transition: border-color 0.3s ease-in-out;
}

input:focus {
  border-color: #999;
}

button {
  background-color: #333;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease-in-out;
}

button:hover {
  background-color: #555;
}
</style>